package com.xiaoma.pattern.observer.mouseevent;

public class MouseEventTest {

    public static void main(String[] args) {
        MouseEventCallBack callback = new MouseEventCallBack();

        //mouse被监听
        Mouse mouse = new Mouse();

        //添加监听器
        mouse.addListener(MouseEventType.ON_CLICK,callback);
        mouse.addListener(MouseEventType.ON_DOUBLE_CLICK,callback);

        mouse.click();
        mouse.doubleClick();

    }
}
